package com.vine.account.controller;

import com.vine.account.entity.XAccount;
import com.vine.account.service.XAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/account")
public class XAccountController {

    @Autowired
    private XAccountService xAccountService;

    /**
     * 查询所有账户
     */
    @GetMapping("/all")
    public List<XAccount> getAll() {
        return xAccountService.getAll();
    }

    /**
     * 根据账户名查询
     */
    @GetMapping("/query")
    public List<XAccount> getByAccount(@RequestParam String account) {
        return xAccountService.getByAccount(account);
    }
}
